package com.itsv.cyzx.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.itsv.cyzx.bean.MeetingBean.MettingDataBean;
import com.itsv.xhyy.R;

public class WeekPlanAdapter extends BaseAdapter {
	private LayoutInflater inflater = null;
	private ArrayList<MettingDataBean> listdata = null;
	private TextView tv_week_time = null, tv_week_name = null;
	private MettingDataBean bean=null;
	public WeekPlanAdapter(Context con) {
		inflater = LayoutInflater.from(con);
	}

	public void setData(ArrayList<MettingDataBean> listdata) {
		this.listdata = listdata;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		if(listdata==null){
			return 0;
		}
		return listdata.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View convertView, ViewGroup arg2) {
		// TODO Auto-generated method stub
		if (convertView == null) {
			convertView = inflater.inflate(R.layout.weekplan_item, null);
		}
		bean=listdata.get(arg0);
		tv_week_time=(TextView) convertView.findViewById(R.id.tv_week_time);
		tv_week_name=(TextView) convertView.findViewById(R.id.tv_week_name);
		
		tv_week_time.setText(bean.getMettingTime());
		tv_week_name.setText(bean.getMettingName());
		 
		return convertView;
	}

}
